.TH E1432_SET_WINDOW 3 E1432
.SH NAME
.nf
e1432_set_window \- Set FFT window type
e1432_get_window \- Get FFT window type
.fi
.IX e1432_set_window(3) 3
.IX e1432_get_window(3) 3
.SH SYNOPSIS
.cS
SHORTSIZ16 e1432_set_window(E1432ID hw, SHORTSIZ16 ID, SHORTSIZ16 window)
SHORTSIZ16 e1432_get_window(E1432ID hw, SHORTSIZ16 ID, SHORTSIZ16 *window)
.cE
.SH DESCRIPTION

\fIe1432_set_window\fR sets the FFT window type.  This window is
applied to input data as part of the FFT.  The FFT can be turned on
using \fIe1432_set_calc_data\fR with the \fBE1432_DATA_FREQ\fR or
\fBE1432_DATA_ORDER\fR parameter.  Windowing is used to reduce leakage
effects caused by input frequency components that are not multiples of
(effective_clock_freq)/(input blocksize).

\fIe1432_get_window\fR returns the current FFT window type.

This parameter is a "global" parameter.  It applies to an entire E1432
module rather than to one of its channels.  The \fIID\fR parameter is
used only to identify which module the function applies to, and all
channels in that module will report the same value for this parameter.

The window that is applied is already scaled for "narrow-band"
measurements.  For "wide-band" measurements, the user must multiply
the data by a factor that depends on which window is used (see below).

\fIhw\fR must be the result of a successful call to
\fIe1432_assign_channel_numbers\fR, and specifies the group of
hardware to talk to.

\fIID\fR is either the ID of a group of channels that was obtained with a
call to \fIe1432_create_channel_group\fR, or the ID of a single channel.

\fIwindow\fR selects one of the following window types:

\fBE1432_WINDOW_UNIFORM\fR selects the Uniform window, which is
equivalent to no windowing at all.

\fBE1432_WINDOW_HANNING\fR selects the Hann window, which is a simple
raised cosine.  This window has good frequency resolution and
reasonably good side-lobe roll-off, but poor main-lobe flatness and
relatively large side-lobe peaks.  This window is often a good window
to use when measuring broad-band noise.  The data will be scaled for
narrow-band measurements; to convert to wide-band, multiply the data
by the square root of 2/3, which is approximately 0.81649658092772603.

\fBE1432_WINDOW_FLATTOP\fR selects a Flat-top window.  This window is
a good window to use when making amplitude or phase measurements of
relatively pure tones.  The maximum side-lobe level is about -95.1 dB,
and the maximum main-lobe error is about plus-or-minus
0.00312487654556 dB.  The data will be scaled for narrow-band
measurements; to convert to wide-band, multiply the data by
0.51150334640807393.

There is a setting of \fBE1432_WINDOW_USER1\fR, but you shouldn't set it
using this function, use \fIe1432_set_user_window\fR function instead,
which will load your own window and then will automatically set the
window type to \fBE1432_WINDOW_USER1\fR.  Once you have loaded your USER
window, changing window type with this function \fIe1432_set_window\fR
will erase your USER window.

.SH "RESET VALUE"
After a reset, \fIwindow\fR is set to \fBE1432_WINDOW_UNIFORM\fR.
.SH "RETURN VALUE"
Return 0 if successful, a (negative) error number otherwise.
.SH "SEE ALSO"
.na
e1432_set_calc_data, e1432_set_user_window
.ad
